﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;

namespace QaaSimulation.QSim.Ships
{
    public abstract class QModelBox
    {
        public static int BOX_RELATION = 40;

        protected float m_Mass = 1.0f;
        public float Mass
        {
            get
            {
                return m_Mass;
            }
            set
            {
                m_Mass = value;
            }
        }

        protected Point m_ArrayPosition;
        public Point ArrayPosition
        {
            get
            {
                return m_ArrayPosition;
            }
            set
            {
                m_ArrayPosition = value;
            }
        }

        protected QBoxSide m_BoxDirection;
        public QBoxSide BoxDirection
        {
            get
            {
                return m_BoxDirection;
            }
            set
            {
                m_BoxDirection = value;
            }
        }

        protected QBoxSide m_AllowedBoxDirections;
        public QBoxSide AllowedBoxDirections
        {
            get
            {
                return m_AllowedBoxDirections;
            }
            set
            {
                m_AllowedBoxDirections = value;
            }
        }

        private QModelBox[] m_Neighbors;
        public QModelBox GetNeighbor(QBoxSide side)
        {
            return m_Neighbors[(int)side];
        }

        public void SetNeighbor(QBoxSide side, QModelBox box)
        {
            m_Neighbors[(int)side] = box;
        }

        public QModelBox()
        {
            m_Neighbors = new QModelBox[4];
        }

        public abstract void Paint(Graphics g);
    
    }

    public enum QBoxSide
    {
        None = 8,
        Top = 0,
        Bottom = 1,
        Left = 2,
        Right = 3        
    }

    //public enum QBoxDirection
    //{
    //    Top = 1,
    //    Bottom = 2,
    //    Left = 4,
    //    Right = 8
    //}
}
